<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        session_start();
        if (!isset($_SESSION['userid']))
        {
            echo"User not logged in";
            echo"</html>";
            exit();
        }
        if (isset($_POST['pdfid']))
        {
            include 'ClassLibs/statics.php';
            $rsResult = rsPdf($_POST['pdfid']);
            $row = mysql_fetch_assoc($rsResult);
            header('Content-type: application/pdf');
            header('Content-Disposition: inline;filename="' . basename($row['FileName']) . '"');
            header('Content-Length: ' . $row['FileSize']);
            ob_clean();
            echo $row['Data'];
        }
        ?>
    </body>
</html>
